home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
fish
/
001-100
/
001-025
/
009
/
setlace
/
setlace.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-17
|
6KB
|
172 lines
/* Downloaded from the "Well" by Fred Fish */
/*
The following program may be used to experiment with the appearance of
your Amiga text and graphics when interlace is turned on. For non-
interlaced "screens", the effect will be to line-double each raster
line. The visual result is that the black "gaps" between raster lines
are dramatically reduced (the pixels appear to have become somewhat
taller). For text, this yields a "fuller" character that many people
find more pleasing.
Because interlace is turned on, many people will notice "flicker" in
the image. The physiology of flicker perception is pretty well
understood. The eye's ability to see flicker increases as the overall
luminence (display plus room light) goes up and as the contrast between
adjacent horizontal lines goes up. Flicker can be dramatically reduced
-- even to the point that you may not see it at all -- by adjusting
the color, contrast, and brightness of your display.
Many folks have turned up the contrast and brightness controls of their
display to get a more striking effect with the Amiga graphics. I
would suggest you start out your experiment by resetting those controls
to their center position. I have found that I get a pleasing image by
adjusting the Workbench colors in Preferences such that the "white"
color is a light grey (4-6 clicks in each of R, G, and B to the left
of the indicator triangle) and the "blue" color is somewhat darker
than default (2 clicks to the left of G and B). I also adjust the
"orange" for balance.
As with any display, you may find it better to use incandescent room
lighting. Flourescent lights also flicker and can "beat" with the
display giving your eyes a real workout.
If you like the results, I'd suggest you stick a SetLace command in
your startup script (s/startup-sequence) just prior to the LoadWB
command.
-------------------- Program Notes:
The program will compile cleanly using the standard V1.0 Lattice C
release stuff. The Make script in the C exmples directory will do
all the work.
The rather large list of include files is necessary to keep Lattice
C from warning about undefined structures. The warnings refer to
structures referenced as the target of pointers in OTHER structure
definitions. We're working on getting the C to be not quite so
picky, so that you can limit your includes to those definitions you
actually use in expressions. These warnings can be safely ignored,
but they don't look clean.
The program is designed to be run from the CLI only. The command
SetLace
will turn on the forced interlace mode. The command
SetLace off
will turn it off again.
Note that forcing interlace does not change either the amount of
memory or bus bandwidth used by text or graphics programs. The
same bitmap is just repeated one half raster line down by the hardware
in the odd frame.
--------------------- Program Source Follows: */
/************************************************************************
* SetLace -- Program to force the Amiga into interlaced display
* regardless of the interlace status of the currently
* active Screens (ViewPorts). Run from the CLI (only).
*
* 1>SetLace -- Set forced Interlace mode
* 1>SetLace off -- Clear forced Interlace mode
*
* Bob Pariseau -- November 2, 1985
*
************************************************************************/
#include <exec/types.h>
#include <exec/tasks.h>
#include <exec/libraries.h>
#include <graphics/copper.h>
#include <graphics/display.h>
#include <graphics/gfxbase.h>
#include <graphics/text.h>
#include <graphics/view.h>
#include <hardware/blit.h>
#include <intuition/intuitionbase.h>
struct GfxBase *GfxBase;
struct IntuitionBase *IntuitionBase;
main(argc, argv)
int argc;
char *argv[];
{
BOOL TurnItOn;
TurnItOn = TRUE;
if (argc > 1)
if (!strcmp(argv[1], "off")) TurnItOn = FALSE;
GfxBase = (struct GfxBase *)OpenLibrary("graphics.library", 0);
if (GfxBase == NULL) exit(1000);
IntuitionBase = (struct IntuitionBase*)
OpenLibrary("intuition.library", 0);
if (IntuitionBase == NULL)
{
CloseLibrary(GfxBase);
exit(2000);
}
/* The system_bplcon0 value is ORed into all copper instructions that
* change bplcon0 (one of the hardware bitplane control registers)
* whenever copper lists are formed by the graphics library copper
* list management routines. This value provides a control context
* for system display that overrides the normal control values usually
* managed by Intuition. In particular, Intuition manages the interlace
* control in the View structure, so we have to do our control here
* to give it some permanence.
*/
if (TurnItOn)
GfxBase->system_bplcon0 |= INTERLACE;
else
GfxBase->system_bplcon0 &= !INTERLACE;
/* Now we have to get all the copper lists rebuilt. The easiest way
* to do this is to have Intuition do it for us. The correct way to
* do THAT is to call RemakeDisplay() which is (sigh) broken in V1.0.
* Therefore, we get by with the following hack.
*/
myRemakeDisplay(IntuitionBase); /*??? RemakeDisplay();*/
/* Be good, and clean up. */
CloseLibrary(GfxBase);
CloseLibrary(IntuitionBase);
}
myRemakeDisplay(IntuitionBase)
struct /* Cheat and use private knowledge */
{ /* of the initial portion of the */
struct Library LibNode; /* Intuition Base structure. */
struct View ViewLord;
} *IntuitionBase;
{
struct View *View;
struct ViewPort *ViewPort;
Forbid(); /* The V1.0 Intuition internal */
/* locking protocol uses Forbid() */
/* and Permit(). Under V1.1, this */
/* code could be unreliable if */
/* another task was simultaneously */
/* manipulating the View. */
View = &IntuitionBase->ViewLord;
ViewPort = View->ViewPort;
while (ViewPort)
{
MakeVPort(View, ViewPort);
ViewPort = ViewPort->Next;
}
Permit();
RethinkDisplay();
}